new Vue({
  el: "#app",
  data: {
    tabActive: 1,
    pageNum: 1, //页码
    pageSize: 10, // 每页展示条数
    listData: [],
    loading: false,
    finished: false,
  },
  created() {
    getEruda()
    window.getPosterMessageListResult = this.getPosterMessageListResult
  },
  mounted() {
    appHiddenNav("0")
    this.onLoad()
  },
  methods: {
    getPosterMessageListResult(res) {
      var arr = JSON.parse(res)
      console.log("app返回数据arr", arr)
      this.listData = [...this.listData, ...arr]
      setTimeout(() => {
        this.loading = false
      }, 2000)
      this.pageNum++
      if (arr.length < this.pageSize) {
        this.finished = true
      }
    },

    onLoad() {
      // 异步更新数据
      var type = "",
        linktype = getUrlKey("subType")
      if (linktype == "1") {
        type = "person"
      } else if (linktype == "2") {
        type = "team"
      }
      this.loading = true
      console.log("获取参数pageNum", this.pageNum)
      console.log("获取参数type", type)
      getPosterMessageList(this.pageNum, this.pageSize, type)
    },

    //图片放大
    doShowPicture(link) {
      showPicture(link)
    },
  },
})
